/*************************************************

  Author:	Gideon Chen
  Version:	1.01
  Date:
   Description:
  Others:
  History:
    1. Date:
       Author:
       Modification:
    2. ...
*************************************************/
#ifndef _MCU_H_
#define _MCU_H_

#ifdef  MCU_GLOBALS
#define MCU_EXT
#else
#define MCU_EXT  extern
#endif

/*
*********************************************************************************************************
*                                              DATA TYPES
*                                         (Compiler Specific)
*********************************************************************************************************
*/


typedef char           uchar;
typedef unsigned long  ulong;
typedef unsigned int   uint;

typedef unsigned int   UINT_t;       
typedef char           BOOL;
typedef char           INT8U;                    /* Unsigned  8 bit quantity                           */
typedef signed char  INT8S;                      /* Signed    8 bit quantity                           */
typedef unsigned int   INT16U;                   /* Unsigned 16 bit quantity                           */
typedef signed   int   INT16S;                   /* Signed   16 bit quantity                           */
typedef unsigned long  INT32U;                   /* Unsigned 32 bit quantity                           */
typedef signed   long  INT32S;                   /* Signed   32 bit quantity                           */
typedef double          FP32;                     /* Single precision floating point                    */
typedef double         FP64;                     /* Double precision floating point                    */


typedef union LongFloatData
{
	INT32U wordu;
    INT32S words;
	INT8U  byte[4];
	FP32   Float;

}LongData;


#if MCU_TYPE == 1
#include <REG516.H>       
#define  CONST  code
#endif


#if MCU_TYPE == MSP430F449
#include <msp430x44x.h>    
#define  ENABLE_INT()       _EINT()
#define  DISABLE_INT()      _DINT()
#define  CONST  const
#define  RS232_0           0
#define  RS232_1           1
extern void InnerADC12_Init(void);   // ADC test
extern INT16U GetADC12(void);

#endif

extern void delay_1us(INT16U kk);
extern void delay_1ms(INT16U time);
extern void Beep(INT8U tims);
extern void BeepOK(void);
extern void BeepError(void);
extern void BeepError(void);
extern BOOL MCU_initial(void);
extern void getBaudRate(INT8U baudrate1,INT8U pattern2);
extern void ifRX_ReceiveEnable(INT8U pcom2,INT8U rsEnable);


#endif


